import wx
class MyFrame(wx.Frame):
    def __init__(self):
        # 创建窗体
        super().__init__(None, title='常用控件', size = (600, 800))
        # 创建面板
        panel = wx.Panel(self)
        # 第一个控件组：用户名
        text1 = wx.StaticText(panel, label = '用户名', pos = (50, 50))
        text_ctrl1 = wx.TextCtrl(panel, size = (400, 20), pos = (100 , 50))
        # 第二个控件组：密码
        text2 = wx.StaticText(panel, label='密   码', pos=(50, 100))
        text_ctrl2 = wx.TextCtrl(panel, size=(400, 20), pos=(100, 100),
                                 style = wx.TE_PASSWORD)
        # 第三个控件组：简介
        text3 = wx.StaticText(panel, label='简   介', pos=(50, 150))
        text_ctrl3 = wx.TextCtrl(panel, size=(400, 80), pos=(100, 150),
                                 style = wx.TE_MULTILINE)
        # 第四个控件组：性别
        text4 = wx.StaticText(panel, label='性   别', pos=(50, 260))
        # 给第一个单选按钮加上style = wx.RB_GROUP，表明这是一组选项
        rb1 = wx.RadioButton(panel, label = '男', pos=(100, 260),
                             style = wx.RB_GROUP)
        rb2 = wx.RadioButton(panel, label = '女', pos=(150, 260))
        # 第五个控件组：技能（复选框）
        text5 = wx.StaticText(panel, label='技   能', pos=(50, 310))
        cb1 = wx.CheckBox(panel, label = 'Java', pos=(100, 310))
        cb2 = wx.CheckBox(panel, label = 'Python', pos=(150, 310))
        cb2.SetValue(True)  # 勾上
        cb3 = wx.CheckBox(panel, label = 'C++', pos=(216, 310))

app = wx.App()
frame = MyFrame()
frame.Show()
app.MainLoop()